package com.ruoyi.ctcx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ctcx.domain.vo.TbInsuranceContractCoinsuranceVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ctcx.mapper.TbInsuranceContractCoinsuranceMapper;
import com.ruoyi.ctcx.domain.TbInsuranceContractCoinsurance;
import com.ruoyi.ctcx.service.ITbInsuranceContractCoinsuranceService;

/**
 * 保险合同共保信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-21
 */
@Service
public class TbInsuranceContractCoinsuranceServiceImpl implements ITbInsuranceContractCoinsuranceService 
{
    @Autowired
    private TbInsuranceContractCoinsuranceMapper tbInsuranceContractCoinsuranceMapper;

    /**
     * 查询保险合同共保信息
     * 
     * @param id 保险合同共保信息主键
     * @return 保险合同共保信息
     */
    @Override
    public TbInsuranceContractCoinsurance selectTbInsuranceContractCoinsuranceById(Long id)
    {
        return tbInsuranceContractCoinsuranceMapper.selectTbInsuranceContractCoinsuranceById(id);
    }

    /**
     * 查询保险合同共保信息列表
     * 
     * @param tbInsuranceContractCoinsurance 保险合同共保信息
     * @return 保险合同共保信息
     */
    @Override
    public List<TbInsuranceContractCoinsuranceVo> selectTbInsuranceContractCoinsuranceList(TbInsuranceContractCoinsurance tbInsuranceContractCoinsurance)
    {
        return tbInsuranceContractCoinsuranceMapper.selectTbInsuranceContractCoinsuranceList(tbInsuranceContractCoinsurance);
    }

    /**
     * 新增保险合同共保信息
     * 
     * @param tbInsuranceContractCoinsurance 保险合同共保信息
     * @return 结果
     */
    @Override
    public int insertTbInsuranceContractCoinsurance(TbInsuranceContractCoinsurance tbInsuranceContractCoinsurance)
    {
        tbInsuranceContractCoinsurance.setCreateTime(DateUtils.getNowDate());
        return tbInsuranceContractCoinsuranceMapper.insertTbInsuranceContractCoinsurance(tbInsuranceContractCoinsurance);
    }

    /**
     * 修改保险合同共保信息
     * 
     * @param tbInsuranceContractCoinsurance 保险合同共保信息
     * @return 结果
     */
    @Override
    public int updateTbInsuranceContractCoinsurance(TbInsuranceContractCoinsurance tbInsuranceContractCoinsurance)
    {
        tbInsuranceContractCoinsurance.setUpdateTime(DateUtils.getNowDate());
        return tbInsuranceContractCoinsuranceMapper.updateTbInsuranceContractCoinsurance(tbInsuranceContractCoinsurance);
    }

    /**
     * 批量删除保险合同共保信息
     * 
     * @param ids 需要删除的保险合同共保信息主键
     * @return 结果
     */
    @Override
    public int deleteTbInsuranceContractCoinsuranceByIds(Long[] ids)
    {
        return tbInsuranceContractCoinsuranceMapper.deleteTbInsuranceContractCoinsuranceByIds(ids);
    }

    /**
     * 删除保险合同共保信息信息
     * 
     * @param id 保险合同共保信息主键
     * @return 结果
     */
    @Override
    public int deleteTbInsuranceContractCoinsuranceById(Long id)
    {
        return tbInsuranceContractCoinsuranceMapper.deleteTbInsuranceContractCoinsuranceById(id);
    }
}
